﻿package 
{

	import flash.display.*;
	import flash.events.*;
	import flash.net.*
	import code.ModuleBase;

	public class BusinessCard extends ModuleBase
	{
		
		///skype:josephine013?add

		var obj;
		public function BusinessCard()
		{
			//
			modname.eng = "Business Card";
			modname.hr = "Business Card";

			//
			title.eng = "Contact me";
			title.hr = "";

			//
			info.eng = "";
			info.hr = "";
			//
			//
			obj={};
			obj.title={};
			obj.info={};
			
		}
		public function init()
		{
			//this.addEventListener(MouseEvent.MOUSE_DOWN,pressMe);			
			this.addEventListener(MouseEvent.MOUSE_OUT,hideInfo);
			
			
			
			gmail.addEventListener(MouseEvent.MOUSE_OVER,showGmail);
			skype.addEventListener(MouseEvent.MOUSE_OVER,showSkype);
			facebook.addEventListener(MouseEvent.MOUSE_OVER,showFacebook);
			linkedin.addEventListener(MouseEvent.MOUSE_OVER,showLinkedin);
			/*
			*/
			gmail.addEventListener(MouseEvent.MOUSE_DOWN,getGmail);
			skype.addEventListener(MouseEvent.MOUSE_DOWN,getSkype);
			facebook.addEventListener(MouseEvent.MOUSE_DOWN,getFacebook);
			linkedin.addEventListener(MouseEvent.MOUSE_DOWN,getLinkedin);
			
		}
		private function showGmail(e)
		{
			obj.title.eng="Contact me by email";
			obj.info.eng="prebegfilip@gmail.com";
			showInfo(0);
		}
		private function showSkype(e)
		{
			obj.title.eng="Contact me by Skype";
			obj.info.eng="skype name: fprebeg";
			showInfo(0);
		}
		private function showFacebook(e)
		{
			obj.title.eng="Contact me at facebook";
			obj.info.eng="http://www.facebook.com/profile.php?id=1097635733";
			showInfo(0);
		}
		private function showLinkedin(e)
		{
			obj.title.eng="Contact me at linkedin";
			obj.info.eng="http://www.linkedin.com/pub/filip-prebeg/17/265/316";
			showInfo(0);
		}
		/*
		*
		*/
		private function getGmail(e)
		{
			getLink("mailto:prebegfilip@gmail.com");
			showInfo(0);
		}
		private function getSkype(e)
		{
			getLink("skype:fprebeg?add");
			showInfo(0);
		}
		private function getFacebook(e)
		{
			getLink("http://www.facebook.com/profile.php?id=1097635733");
			showInfo(0);
		}
		private function getLinkedin(e)
		{
			getLink("http://www.linkedin.com/pub/filip-prebeg/17/265/316");
			showInfo(0);
		}
		
		
		/*
		*
		*
		*
		*
		*
		*
		*/
		
		private function showInfo(e)
		{
			mainframe.showMediumInfo(obj);
		}
		private function hideInfo(e)
		{
			mainframe.hideInfo();
		}
		
		private function getLink(e)
		{	
			var req=new URLRequest(e)
			navigateToURL(req,"_blank");
			
		}
	}

}